export function pixelImage(data){
	 return new Promise((resolve, reject) => {  
		return uni.request({
		  url: 'imgStore/imageTool/pixelImage', 
		  method: 'post', 
		  header: {
			  'Content-Type': 'application/x-www-form-urlencoded'  
		  },
		  dataType:'json',
		  data: data,
		  success: (res) => {
			resolve(res.data)
		  },
		  fail: (err) => {
			reject(err)
		  }
		});
	});
}


export function mirrorImage(data){
	 return new Promise((resolve, reject) => {  
		return uni.request({
		  url: 'imgStore/imageTool/mirrorImage', 
		  method: 'post', 
		  header: {
			  'Content-Type': 'application/x-www-form-urlencoded'  
		  },
		  dataType:'json',
		  data: data,
		  success: (res) => {
			resolve(res.data)
		  },
		  fail: (err) => {
			reject(err)
		  }
		});
	});
}


export function getQrImg(data){
	 return new Promise((resolve, reject) => {  
		return uni.request({
		  url: 'imgStore/imageTool/getQrImg', 
		  method: 'post', 
		  header: {
			  'Content-Type': 'application/x-www-form-urlencoded'  
		  },
		  dataType:'json',
		  data: data,
		  success: (res) => {
			resolve(res.data)
		  },
		  fail: (err) => {
			reject(err)
		  }
		});
	});
}


export function memeGenerate(data){
	return new Promise((resolve, reject) => { 
		uni.request({
		    url: 'imgStore/meme/generate',
		    method: 'POST',
		    data: data,
		    success: (res) => {
		      const memeUrl = res.data;
			  resolve(memeUrl)
		    },
			fail: (err) => {
				reject(err)
			},
		});
	});
}		 
